package com.compiler.lexico.action;

import java.io.IOException;
import java.io.RandomAccessFile;

import com.compiler.lexico.token.SymbolTable;
import com.compiler.lexico.token.Token;

public class InsertSimbol extends AbstractAction {
	
	public InsertSimbol(Token token, SymbolTable symbolTable) {
		super(token,symbolTable);
	}

	@Override
	public void exec(RandomAccessFile raf) throws IOException {
		this.symbolTable.addToken(new Token(token.getData(),token.getData(),token.getLine(),(int)token.getData().charAt(0)));
		this.token.clean();
	}

	@Override
	public String toString() {
		return "Insert";
	}

}
